#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "net.h"
#include <QMainWindow>
#include <cstring>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

//     void  tcp_protocol_packet_callback(u_char *argument, const struct pcap_pkthdr*
//         packet_header, const u_char* packet_content);
//     void   ip_protocol_packet_callback(u_char *argument, const struct pcap_pkthdr*
//         packet_header, const u_char* packet_content);
//     void  ethernet_protocol_packet_callback(u_char *argument, const struct pcap_pkthdr *packet_header, const u_char* packet_content);

private slots:
    void on_pbt_begin_clicked();


    void on_listwgt_pack_currentRowChanged(int currentRow);

private:

    pcap_t *adhandle;
    Ui::MainWindow *ui;
    void tableInit();
    int macInit(pcap_t *adhandle);
    void updateTable(int index);

};

#endif // MAINWINDOW_H
